<?php


namespace app\api\controller\v1;


use app\facade\Goods as GoodsFacade;
use app\facade\GoodsCollect;

class Ticketing extends Base
{
    //购票中心初始化
    public function ticketingInit(){
        $this->checkUserToken();
        $where  = [
            'is_sale' => 1,
            'goods_type' => 3,
        ];
        $info = GoodsFacade::goods($where)[0];

        $info['goods_detail'] = str_replace('src="/static/', 'src="'.config('system.attach_uri_prefix').'static/', $info['goods_detail']);

        if ($info) {
            return j(0, '获取商品详情成功', $info);
        }
        return j(1, '获取商品信息失败');
    }
    //验证身份证号姓名
    public function Authentication(){
//        $user_id = $this->checkUserToken();
        $post = input('');
        $username = explode(",",$post['username']);
        $id_number = explode(",",$post['id_number']);
        $phone = explode(",",$post['phone']);
        $arr = [];;
        foreach ($username as $key => $value ){
            if (!empty($value)){
                $arr[$key]['username'] = $value;
                $arr[$key]['id_number'] = $id_number[$key];
                $arr[$key]['phone'] = $phone[$key];
            }
        }

        die(dump($arr));
    }
}